#pragma once

#include <stdint.h>
void backlight_init();
void disp_gpio_init(); 
void disp_rgb_init();

// 8080屏幕
#define LCD_WIDTH 480
#define LCD_HIGHT 320

void disp_pixel(uint16_t x, uint16_t y, uint32_t color);
void disp_fill (uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t color) ;
void disp_clear(uint32_t color);

extern uint16_t lcd_gram[LCD_WIDTH * LCD_HIGHT];

#ifndef WORD
typedef unsigned short WORD;
#endif
uint32_t ARGB(WORD rgb565);

// 8080屏幕
#define COLOR565_BLACK   0x0000
#define COLOR565_BLUE    0x001F
#define COLOR565_GREEN   0x07E0
#define COLOR565_RED     0xF800
#define COLOR565_YELLOW  0xFFE0
#define COLOR565_WHITE   0xFFFF
#define COLOR565_ORANGE  0xFC00
#define COLOR565_PURPLE  0xF81F

typedef enum
{
    LCD_DIRECTION_0,
    LCD_DIRECTION_90,
    LCD_DIRECTION_180,
    LCD_DIRECTION_270
} eLcdDirection;

void lcdDirectFlush(bool enabled);
void lcdSetWindows(uint16_t x, uint16_t y, uint16_t width, uint16_t height);
